<?php
App::uses('AppModel', 'Model');
class Advertise extends AppModel {

	public $name = 'Advertise';
	public $useTable = 'advertise';


	public function getAllBanner(){
		try{
			$results = $this->query(
					"SELECT id,ban_name,ban_link,ban_picture,ban_type
					FROM advertise
					WHERE ban_active = 1 AND del_flg = 0
					ORDER BY ban_type ASC, ban_order ASC");
			return  $results;

		} catch (Exception $e) {
			throw new NotFoundException(__('Invalid category'));
		}
	}
}